import weather.*;

import java.lang.Thread;
import java.util.Timer;
import java.util.TimerTask;

public class Program {

	public static void main(String[] args) {
		Central central = new Central();
		
		String[] locations = { "vienna", "moscow", "tokyo", "bangkok", "kapstadt" };
		
		for (String location: locations) {
			central.addStation(location);
		}
		
		(new Timer()).scheduleAtFixedRate(new TimerTask() {
			long t0 = System.currentTimeMillis();
			
			@Override
			public void run() {
				if (System.currentTimeMillis() - t0 > 20 * 1000) {
					cancel();
				} else {
					central.measurementEvent();
				}
			}
		}, 0, 1000 * 5);
	}

}